package com.matt.domain.statistics;

import com.matt.foundation.model.Domain;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/7/19
 * *******************************
 */
@Data
@Entity
@Table(name = "stat_end_clientele")
@EqualsAndHashCode(callSuper = true)
public class StatEndClientele extends Domain {

    @Column(columnDefinition = "varchar(32)  COMMENT '对应客户id'")
    private String clienteleId;

    @Column(columnDefinition = "int default 1  COMMENT '1：正常结束，2：非正常结束'")
    private Integer type;

    @Column(columnDefinition = "varchar(32) COMMENT '所属园区'")
    private String areaId;

    public static StatEndClientele of(String clienteleId, Integer type, String areaId, Date date){
        StatEndClientele stat = new StatEndClientele();
        stat.setClienteleId(clienteleId);
        stat.setType(type);
        stat.setAreaId(areaId);
        stat.setCreated(date);
        return stat;
    }
}
